<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTableAdmins extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('admins', function (Blueprint $table) {
            $table->increments('admin_id')->comment('管理员id');
            $table->char('admin_name',12)->unique()->default('')->comment('管理员用户名');
            $table->char('admin_pwd',32)->default('')->comment('管理员密码');
            $table->char('salt',6)->default('abcdef')->comment('密码加盐');
            $table->tinyInteger('admin_level')->default(2)->comment('管理员等级，1为创始人,2为普通管理员');
            $table->tinyInteger('admin_stauts')->default(1)->comment('管理员状态,0失效1正常');
            $table->integer('regtime')->default(0)->comment('管理员注册时间');
            $table->integer('lastlogin')->default(0)->comment('管理员上次登录时间');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('admins');
    }
}
